package com.mantru.iotpot.Service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import com.mantru.iotpot.Begin.FirstActivity;

public class BootService extends Service {
    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        // 启动 MainActivity
        Intent launchIntent = new Intent(this, FirstActivity.class);
        launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(launchIntent);

        // 停止服务
        stopSelf();
        return START_NOT_STICKY;
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}
